import subprocess, os

def execCmd(folder,arg):
    folder=os.path.abspath(folder)
    if folder:
        arg[0]=folder+"/"+arg[0]
    print ("*execCmd : "+" ".join(arg))
    pipe = subprocess.Popen(arg,shell=False)
    print pipe.pid
    return pipe

def execCmd2(arg):
    p = subprocess.Popen(arg, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
    output = p.stdout.read()
    return output